registerHTML Method |
This method registers the element specified to the translator component.
Syntax
object.registerHTML(oElement [, sText]);
Parameters
Parameter |
Description |
---|---|
oElement |
Required. The HTML element that needs to be registered with the translator component. |
sText |
Optional. String that serves as the label_id of the HTML Element added, which is used for dictionary lookup. |
Return Value
No return value.
Remarks
Once the element is registered, the element will be translated to the current language the user is in. This method is generally used when an item is dynamically added to the page. This is the only method that can be called before the translator component becomes 'active'.
Example
The following example shows how the registerHTML method is used to register an option of the context menu to the translator component:
var name = prompt("Enter another Context Menu Item Name",""); //myContext is the id of the contextmenu and translator is the id of the translator component var contextItem = document.all['myContext']; var addedItem = contextItem.addItem("",addedContext,name,true); translator.registerHTML(addedItem, addedItem.innerHTML);